package cn.tedu.blog.server.pojo.dto;

import cn.tedu.blog.server.utils.DateUtils;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author 雷茂林
 * @description: 角色表
 * @date
 */

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("b_role")
@ApiModel(value="角色管理")
public class RoleAddNewDTO implements Serializable {

    @ApiModelProperty(value = "角色ID",name = "id")
    private Long id;

    @ApiModelProperty(value = "角色名称",name = "name",example = "测试菜单")
    private String name;

    @ApiModelProperty(value = "角色描述",name = "description",example = "测试")
    private String description;

    @ApiModelProperty(value = "排序",name = "sort",example = "0")
    private Integer sort;

    @ApiModelProperty(value = "角色状态",name = "status",example = "1")
    private Integer status;


    //FieldFill.INSERT：添加时自动填充实现
    @ApiModelProperty(value = "创建时间",name = "gmtCreate")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private LocalDateTime gmtCreate;



    //FieldFill.UPDATE：修改时自动填充实现
    @ApiModelProperty(value = "修改时间",name = "gmtModified")
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private LocalDateTime gmtModified;

}
